<!-- 老师月发布排行 -->
<template>
  <div class="month">
    <span v-for="(item, index) in btnArr" :key="(index)" :class="{ active: currentIndex == index }"
      @click="btnClick(index)">{{ item }}</span>
    <div class="local">
      <el-config-provider :locale="zhCn">
        <el-date-picker unlink-panels v-model="value" type="daterange" start-placeholder="起始日期" end-placeholder="结束日期"
          :calendar-change="[Date(), Date()]" />
      </el-config-provider>
    </div>
    <div class="query">
      <el-input v-model="input3" clearable placeholder="请输入关键字进行搜索" class="queryinput">
        <template #prepend>
          <el-select v-model="select" placeholder="选择信息" clearable style="width: 100px">
            <el-option label="姓名" value="1" style="color:black" />
            <el-option label="学校地址" value="2" style="color:black" />
          </el-select>
        </template>
        <template #append>
          <el-button style="background-color: #1890ff; color: #fff;">查询</el-button>
        </template>
      </el-input>
    </div>
  </div>
  <el-table :data="tableData.list" border stripe style="font-size: 12px;" :cell-style="{ 'text-align': 'center' }">
    <el-table-column type="index" label="序号" width="100" header-align="center" />
    <el-table-column prop='teachername' label="姓名" width="100" header-align="center" />
    <el-table-column prop="school" label="所属学校" width="100" header-align="center" />
    <el-table-column prop="Total" label="合计" width="100" header-align="center" />
    <el-table-column prop="Inform" label="通知" width="100" header-align="center" />
    <el-table-column prop="Notice" label="公告" width="100" header-align="center" />
    <el-table-column prop="Activity" label="活动" width="100" header-align="center" />
    <el-table-column prop="Hometask" label="家园任务" width="100" header-align="center" />
    <el-table-column prop="Debitnote" label="缴费通知" width="100" header-align="center" />
    <el-table-column prop="SelectionNotice" label="选课通知" width="100" header-align="center" />
    <el-table-column prop="Homework" label="作业" width="100" header-align="center" />
    <el-table-column prop="Leave" label="请假" width="100" header-align="center" />
    <el-table-column prop="Publishalbum" label="发布相册" width="100" header-align="center" />
    <el-table-column prop="elaluate" label="评价" width="100" header-align="center" />
    <el-table-column prop="vote" label="投票" width="100" header-align="center" />
    <el-table-column prop="hint" label="带药提醒" width="100" header-align="center" />
  </el-table>
</template>

<script setup>
import { teacher_News } from '../../../utils/api';
import { onDeactivated, onMounted, ref } from 'vue';
// import { before, method } from 'lodash';
// 中文
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
// var locale = ref(zhCn)

//标签
var btnArr = ref(['月份', '日期']);
var currentIndex = ref(0);
var btnClick = (index) => {
  currentIndex.value = index;
}

//查询
var searchText = ref("")

var shopsearch = () => {
  if (searchText.value) {

  }
}

// 信息选择框
// const input1 = ref('')
// const input2 = ref('')
const input3 = ref('')
const select = ref('')

//定义响应式数据
var tableData = ref({
  list: []
})

onMounted(() => {
  teacher_News().then((res) => {
    // console.log(res.data.teacherList)
    tableData.value.list = res.data.teacherNews;
  })
})

</script>
<style lang="scss" scoped>
// 日期头
.month {
  width: 100%;
  display: flex;
  position: relative;

  span {
    display: inline-block;
    width: 50px;
    height: 30px;
    margin-bottom: 10px;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    // margin-left: 1px;
    color: #666666;
    font-size: 12px;
    border: 1px solid rgba(228, 228, 228, 1);
    border-radius: 3px;
  }

  span.active {
    background-color: rgb(45, 169, 250);
    color: #fff;
  }

  .query {
    position: absolute;
    right: 20px;

    .queryinput {
      font-size: 12px;
      width: 350px;
    }
  }
  .local{
    position: absolute;
    left: 130px;
  }
}

// 列表
</style>